package com.bignerdranch.android.ecar.Activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import com.bignerdranch.android.ecar.Adapter.FaultResultAdapter;
import com.bignerdranch.android.ecar.Bean.FaultResultBean;
import com.bignerdranch.android.ecar.R;

import java.util.ArrayList;
import java.util.List;

public class FaultResultActivity extends BaseActivity implements View.OnClickListener {

    private ImageButton result_back;
    private TextView result_license;
    private TextView result_car_type;
    private TextView result_status;
    private TextView result_count;
    private TextView result_money;
    private TextView result_point;
    private ListView result_list;
    private List<FaultResultBean> mData;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fault_result);
        initView();
        initData();
        result_list.setAdapter(new FaultResultAdapter(this,mData));
    }

    private void initView() {
        result_back = (ImageButton) findViewById(R.id.result_back);
        result_license = (TextView) findViewById(R.id.result_license);
        result_car_type = (TextView) findViewById(R.id.result_car_type);
        result_status = (TextView) findViewById(R.id.result_status);
        result_count = (TextView) findViewById(R.id.result_count);
        result_money = (TextView) findViewById(R.id.result_money);
        result_point = (TextView) findViewById(R.id.result_point);
        result_list = (ListView) findViewById(R.id.result_list);

        result_back.setOnClickListener(this);
    }

    private void initData(){
        mData = new ArrayList<>();
        for(int i = 0;i < 5;i++){
            FaultResultBean bean = new FaultResultBean("2015-09-09","中原路","乱停车","未裁决","未缴款","200"+"元",i+"分");
            mData.add(bean);

        }
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.result_back:

                finish();
                break;

        }
    }
}
